<?php 
	
class sponsor {

	private $idSponsor;
	private $nom ;   
	private $activite; 

	
	public function __construct()
	{
		$this->db = new myPdo ;
		$req="set names 'UTF8'";
		$this->db->exec($req);
	}
	
	// SETTEURS
	public function setIdSponsor($idSponsor) 
	{
		$this->idSponsor = $idSponsor ;
	}
	public function setNom($nom) 
	{
		$this->nom = $nom ;
	}
	public function setActivite($activite) 
	{
		$this->activite = $activite  ;
	}
	
	
	
	// GETTEURS
	public function getIdSponsor() 
	{
		return $this->idSponsor;
	}
	public function getNom() 
	{
		return $this->nom;
	}
	public function getActivite() 
	{
		return $this->activite;
	}

	
	
	public function remplirSponsor()
	{
		$r = "SELECT SPONUM, SPONOM, SPOSECTACTIVITE FROM sponsor WHERE SPONUM = '$this->idSponsor' ; " ;
		$resu = $this->db->query($r) ;
		
		$ligne = $resu->fetch(PDO::FETCH_OBJ) ;
		
		$this->nom = $ligne->SPONOM ;
		$this->activite = $ligne->SPOSECTACTIVITE ;
		
		//$this->adresse = $resu->fetch(PDO::FETCH_OBJ)->PHOADRESSE ;
	}
	
	
}
?>